---
runner_tokens:
  com-ocp3-kubernetes-high: {{ COM_OCP3_KUBERNETES_HIGH_RUNNER_TOKEN }}
  com-ocp3-kubernetes-normal: {{ COM_OCP3_KUBERNETES_NORMAL_RUNNER_TOKEN }}
  com-server-docker-priv: {{ COM_SERVER_DOCKER_PRIV_RUNNER_TOKEN }}
  corp-ocp3-kubernetes-high: {{ CORP_OCP3_KUBERNETES_HIGH_RUNNER_TOKEN }}
  corp-ocp3-kubernetes-normal: {{ CORP_OCP3_KUBERNETES_NORMAL_RUNNER_TOKEN }}
  corp-server-docker-priv: {{ CORP_SERVER_DOCKER_PRIV_RUNNER_TOKEN }}
  project1-ocp4-kubernetes-normal: {{ PROJECT1_OCP4_KUBERNETES_NORMAL_RUNNER_TOKEN }}
  project1-server-docker-priv: {{ PROJECT1_SERVER_DOCKER_PRIV_RUNNER_TOKEN }}

gitlab_instances:
  com:
    url: https://gitlab.com/
    api_token: {{ COM_GITLAB_TOKEN_ADMIN_BOT }}
    registration_tokens:
      external-group: {{ COM_GITLAB_REGISTRATION_TOKEN }}
  corp:
    url: https://gitlab.corp.com/
    api_token: {{ CORP_GITLAB_TOKEN_ADMIN_BOT }}
    registration_tokens:
      internal-group: {{ CORP_GITLAB_REGISTRATION_TOKEN }}
      internal-group/project1: {{ CORP_GITLAB_REGISTRATION_TOKEN_PROJECT1 }}

runner_deployments:
  .default:
    check_interval: 0
    log_level: info
  .kubernetes:
    .executor: kubernetes
    .filename: config.toml
    .metadata:
      labels:
        app: {{ PROJECT_NAME }}
      name: {{ PROJECT_NAME }}
    concurrent: 100
  ocp3:
    .extends: .kubernetes
    .secret: ocp3-secret.yaml
    .template_overrides:
      kubernetes:
        namespace: {{ OPENSHIFT_PROJECT }}
  ocp4:
    .extends: .kubernetes
    .secret: ocp4-secret.yaml
    .template_overrides:
      kubernetes:
        namespace: {{ OPENSHIFT4_PROJECT }}
  server:
    .executor: docker
    .configfile: server-config.toml
    concurrent: 10

runner_templates:
  .default:
    .cache: {{ BUCKET_RUNNER_CACHE }}
  .docker:
    executor: docker
    docker:
      tls_verify: false
  .kubernetes:
    executor: kubernetes
    kubernetes:
      privileged: false
  docker-priv:
    .extends: .docker
    .tags:
      default:
        - image-builder
      disabled: []
    docker:
      privileged: true
  kubernetes-high:
    .extends: .kubernetes
    .tags:
      default:
        - build
      disabled: []
    limit: 4
    kubernetes:
      cpu_request: "20"
      cpu_limit: "20"
      memory_request: 8Gi
      memory_limit: 8Gi
  kubernetes-normal:
    .extends: .kubernetes
    .tags:
      default:
        - test
      disabled: []
    limit: 20
    kubernetes:
      cpu_request: "4"
      cpu_limit: "4"
      memory_request: 4Gi
      memory_limit: 4Gi

variable_groups:
  home:
    HOME: /tmp
  group-default:
    DEFAULT_EMAIL: email@example.com
  project1:
    .extends: group-default
    GITLAB_PASSWORD: {{ GITLAB_PASSWORD }}

runner_configurations:
  com:
    runner_deployments: [ocp3, server]
    variable_group: home
    runner_templates:
      - kubernetes-high
      - kubernetes-normal
      - docker-priv
    gitlab_groups: com/external-group
  corp:
    runner_deployments: [ocp3, server]
    variable_group: home
    runner_templates:
      - kubernetes-high
      - kubernetes-normal
      - docker-priv
    gitlab_groups: corp/internal-group
  project1:
    runner_deployments: [ocp4, server]
    variable_group: home
    runner_templates:
      - kubernetes-normal
      - docker-priv
    gitlab_projects: corp/internal-group/project1

gitlab_variables:
  - gitlab_groups:
      - corp/internal-group
      - com/external-group
    variable_group: group-default
  - gitlab_projects:
      - corp/internal-group/project1
    variable_group: project1

webhook_endpoints:
  - url: https://webhook.endpoint/gitlab
    .pattern: https://(webhook.endpoint|old.endpoint)/gitlab
    .secret_token: {{ WEBHOOK_SECRET }}
    .routing_keys:
      - {{ CONSUMER1_ROUTING_KEYS }}
      - {{ CONSUMER2_ROUTING_KEYS }}
      - gitlab.corp.com.internal-group.project1.build
